package com.darker.listener;

import java.util.EventObject;

public class Main {
    public static void main(String[] args) {
        // 事件
        EventSource source = new EventSource();
        source.addListener(new EventerListener() {
            @Override
            public void handleEvent(EventerObject eventObject) {
                eventObject.doEvent();
                if ("close door".equals(eventObject.getSource())){
                    System.out.println("doClose");
                }

            }
        });

        source.notifyListenerEvents(new EventerObject("zhangsan"));
    }
}
